﻿<!-- © kaveh.shahbazian@gmail.com and http://www.codeplex.com/site/users/view/Cread 2010-2011 (see license.txt) -->
<ribbon:RibbonWindow x:Class="Funtastic.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
        xmlns:avalonEdit="clr-namespace:ICSharpCode.AvalonEdit;assembly=ICSharpCode.AvalonEdit"
		x:Name="mainWindow" MinWidth="300" Title="Funtastic"
		Width="800" Height="800" Icon="/Funtastic;component/paste.ico"
        KeyDown="mainWindow_KeyDown">

	<Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <ribbon:Ribbon x:Name="Ribbon">
            <!-- Menu -->
            <ribbon:Ribbon.ApplicationMenu>
                <ribbon:RibbonApplicationMenu x:Name="ribbonMenu">
                    <ribbon:RibbonApplicationMenuItem Header="New"
                                                      x:Name="btnnew"
                                                      ImageSource="Images\NewDocument.png"/>
                    <ribbon:RibbonApplicationMenuItem Header="Open"
                                                      x:Name="btnopen"
                                                      ImageSource="Images\Open.png"/>
                    <ribbon:RibbonApplicationMenuItem Header="Save"
                                                      x:Name="btnsave"
                                                      ImageSource="Images\FloppyDisk.png"/>
                    <ribbon:RibbonApplicationMenuItem Header="Save as..."
                                                      x:Name="btnsaveas"
                                                      ImageSource="Images\FloppyDisk.png"/>

                    <ribbon:RibbonApplicationMenu.FooterPaneContent>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <ribbon:RibbonButton Grid.Column="1" Label="Options" Click="RibbonButton_Click" />
                            <ribbon:RibbonButton Grid.Column="2" Label="Close" SmallImageSource="Images\Close.png" Click="end_Click" />
                        </Grid>
                    </ribbon:RibbonApplicationMenu.FooterPaneContent>

                    <ribbon:RibbonApplicationMenu.AuxiliaryPaneContent>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <ribbon:RibbonSeparator Grid.Row="0" Margin="5" Label="Recent Documents"/>
                            <ListBox Grid.Row="1" x:Name="recentItems" SelectionChanged="recentItems_SelectionChanged" >
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <Border BorderThickness="1" Margin="5,2,5,2" BorderBrush="DarkBlue"
                                                HorizontalAlignment="Stretch" Width="280">
                                            <Grid Height="23">
                                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                                                    <TextBlock Text="{Binding Name}" Width="80" Margin="2" />
                                                    <TextBlock Text="{Binding FullName}" Width="110" Margin="2" TextTrimming="CharacterEllipsis" />
                                                </StackPanel>
                                                <TextBlock HorizontalAlignment="Right" Text="{Binding Date}" Width="80" Margin="2" />
                                            </Grid>
                                        </Border>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                        </Grid>
                    </ribbon:RibbonApplicationMenu.AuxiliaryPaneContent>

                </ribbon:RibbonApplicationMenu>
            </ribbon:Ribbon.ApplicationMenu>
            
            <!-- Tabs -->
            <ribbon:RibbonTab x:Name="HomeTab" 
                              Header="Start">
                <ribbon:RibbonGroup x:Name="Group1" 
                                    Header="Copy and Paste">
                    <ribbon:RibbonButton x:Name="btnBack" Click="btnBack_Click"
                                         SmallImageSource="Images\Back.png"
                                         Label="Undo" />
                    <ribbon:RibbonButton x:Name="btnForeward" Click="btnForeward_Click"
                                         SmallImageSource="Images\Redo.png"
                                         Label="Redo" />
                    <ribbon:RibbonButton x:Name="btnPaste" Click="btnPaste_Click"
                                         SmallImageSource="Images\Paste.png" LargeImageSource="Images\Paste.png"
                                         Label="Paste" />
                    <ribbon:RibbonButton x:Name="btnCopy" Click="btnCopy_Click"
                                         SmallImageSource="Images\copy.png" LargeImageSource="Images\copy.png"
                                         Label="Copy" />
                    <ribbon:RibbonButton x:Name="btnCut" Click="btnCut_Click"
                                         SmallImageSource="Images\cut.png" LargeImageSource="Images\cut.png"
                                         Label="Cut" />
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup x:Name="fsharp" 
                                    Header="F#">
                    <ribbon:RibbonButton x:Name="btnInteractive"
                                         LargeImageSource="Images\GreenArrow.png" SmallImageSource="Images\GreenArrow.png"
                                         Label="Interactive" Click="btnInteractive_Click"/>
                    <ribbon:RibbonButton x:Name="btnRestart"
                                         SmallImageSource="Images\RefreshArrow.png" Label="Restart Fsi" Click="btnRestart_Click"/>
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup Header="View">
                    <ribbon:RibbonComboBox
                        Name="comboLayout" SelectionBoxWidth="120">
                        <ribbon:RibbonGallery  x:Name="comboLayoutGallery"
                            SelectedValue="vertical stacking" 
                            SelectedValuePath="Content" 
                            MaxColumnCount="1">
                            <ribbon:RibbonGalleryCategory>
                                <ribbon:RibbonGalleryItem x:Name="Vertical"
                                    Content="vertical stacking" />
                                <ribbon:RibbonGalleryItem x:Name="Horizontal"
                                    Content="horizontal stacking" />
                                <ribbon:RibbonGalleryItem x:Name="Hidden"
                                    Content="only code" />
                            </ribbon:RibbonGalleryCategory>
                        </ribbon:RibbonGallery>
                    </ribbon:RibbonComboBox>
                    <StackPanel Orientation="Horizontal">
                        <ribbon:RibbonTextBox Height="23" Name="zoomTb" Text="14" Label="FontSize" />
                        <ribbon:RibbonButton x:Name="btnChangeZoom" Click="btnChangeZoom_Click" SmallImageSource="Images\Redo.png" />
                    </StackPanel>
                    <ribbon:RibbonButton x:Name="btnClearOutput" Click="btnClearOutput_Click" Label="Clear output"
                                         LargeImageSource="Images\NewDocument.png" />
                </ribbon:RibbonGroup>

            </ribbon:RibbonTab>
            
            <ribbon:RibbonTab Header="Web">
                <ribbon:RibbonGroup Header="online Services">
                    <ribbon:RibbonButton x:Name="btnPastebin" Click="btnPastebin_Click" Label="Upload to Pastebin.com"
                                         LargeImageSource="Images\UpArrow.png" />
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
        </ribbon:Ribbon>
        
        <!-- MainWindow Content -->
        <Grid x:Name="innerContent" Grid.Row="1" Margin="4">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <GridSplitter Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2"
                      VerticalAlignment="Bottom" HorizontalAlignment="Right"
                      Width="Auto" Height="4" x:Name="GridSplitter"
                      Background="LightGray" ResizeDirection="Rows"></GridSplitter>
            <avalonEdit:TextEditor
				    Name="avaEditor" Grid.ColumnSpan="2"
				    FontFamily="Consolas" Margin="0,0,4,4"
				    FontSize="14"
				    SyntaxHighlighting="F#"
                    Drop="avaEditor_Drop"
			    >// select the code that you want to send to F# interactive then press Alt + Enter
            </avalonEdit:TextEditor>
            <TextBox Name="tbOutput" FontFamily="Consolas" FontSize="14"
                 HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"
                 IsReadOnly="True" Grid.Row="2" Grid.ColumnSpan="2" Background="White"
                 IsUndoEnabled="False" Margin="0,0,0,4" />
        </Grid>
    </Grid>
</ribbon:RibbonWindow>
